package com.linser.gistools.common.datastore.model;

import javafx.concurrent.Task;
import org.geotools.data.DataStore;
import org.geotools.data.Query;
import org.geotools.data.simple.SimpleFeatureCollection;
import org.opengis.feature.simple.SimpleFeatureType;
import org.opengis.filter.Filter;

import java.util.List;
import java.util.Map;

public interface BaseDataStoreInterface {
    String getVersion();

    String getUuid();

    void setUuid();

    void setUuid(String uuid);

    DbInfo getDbInfo();

    void setDbInfo(DbInfo dbInfo);

    /**
     * 获取表格列表
     * @return
     */
    List<DataTableModel> getDbTableLst();

    void setDbTableLst(List<DataTableModel> dbTableLst);

    Map<String, Object> getLocalConnectionDataMap();

    void setLocalConnectionDataMap(Map<String, Object> localConnectionDataMap);

    DataStore getDataStore();

    void setDataStore(DataStore dataStore);

    List getChildsLst();

    List refreshChildsLst();

    String getUrlStr();

    List<FieldModel> getTableField(String tableName);

    void update();

    Integer queryFeatureCount(String featureName, Filter fiter);

    SimpleFeatureCollection queryFeatureByQuery(String featureName, Query query);

    boolean equalsWithMap(Map params);

    boolean appendData(SimpleFeatureCollection sourceFeatureCollection, DataTableModel targetTable);


    Task<Void> appendFeatures(SimpleFeatureCollection source, SimpleFeatureType targetFeatureType);

    boolean delTable(String tableName);

    Integer getTableEpsgCode(String tableName);

    boolean testDbStoreSql(String sql);

    SimpleFeatureCollection getfeaturesByTableName(String tableName);
}
